package com.crm.model.vo.csd.customerManager;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * @author yincuimei
 * @Date 2021/10/25 14:06
 * (客服部)客户管理-》联系人维护列表返给前端实体
 */
@Data
public class ContactMaintainVO {
    //联系人表主键
    private String contactId;

    //联系人姓名
    private String contactName;

    //联系方式
    private String contactInformation;

    //所属客户(关联客户表查)
    private String customerName;

    //所属客户ID
    private String customerId;

    //客户类型
    private Integer memberGrade;

    //客户类型(页面显示值)
    private String memberGradeText;

    //创建时间
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm",timezone="GMT+8")
    private Date createTm;

    //职务
    private String contactPosition;

    //所有人ID
    private String accountId;

    //所有人姓名(关联账号表查)
    private String ownerPeopleName;

    //所属分公司ID
    private String companyId;

    //所属分公司名称
    private String companyName;

    //是否审核
    private Integer isExamine;

    //是否审核(页面显示值)
    private String isExamineText;

    //联系人性质  0-企业联系人;1-个人联系人
    private Integer contactNature;

    public String getMemberGradeText(){
        String memberGradeText = "";
        if(memberGrade != null){
            switch(memberGrade){
                case 1 :
                    memberGradeText = "会员客户";
                    break;
                case 2 :
                    memberGradeText = "非会员客户";
                    break;
                default :
                    break;
            }
        }
        return memberGradeText;
    }

    public String getIsExamineText(){
        String isExamineText = "";
        if(isExamine != null){
            switch(isExamine){
                case 0 :
                    isExamineText = "未审核";
                    break;
                case 1 :
                    isExamineText = "真实";
                    break;
                case 2 :
                    isExamineText = "错误";
                    break;
                default :
                    break;
            }
        }
        return isExamineText;
    }
}
